<include file="application/home/view/public/header.html"/>
      <!-- /.aside -->
      <section id="content">
        <section class="vbox">
          <section class="scrollable padder">
             <header class="header bg-light bg-gradient b-b">
            <p>积分转换</p>
          </header>
          <form class="form-horizontal" data-validate="parsley">
                <section class="panel panel-default">
                    <div class="panel-body">
                    <header class="panel-heading"> <strong>积分转换</strong> </header>
                      <div class="form-group">
                        <label class="col-sm-3 control-label">转换类型：</label>
                        <div class="col-lg-4">
                          	<select  name='type' id="type" class="form-control">
								<option value="">请先选择</option>
								<foreach name="aa" item='va'>
									<option value="{$va.id}" data-name="{$va.first_jifen_name}" data-jifen="{$va.first_jifen}">{$va.name}</option>
								</foreach>
							</select>
                        </div>
                      </div>
                      <div class="line line-dashed line-lg pull-in"></div>
                      <div class="form-group">
                        <label class="col-sm-3 control-label" id="ass">我的资产</label>
                        <div class="col-lg-4">
                         <input type="text" class="form-control" name="assect" disabled>
                        </div>
                      </div>
                      <div class="line line-dashed line-lg pull-in"></div>
                      <div class="form-group">
                        <label class="col-sm-3 control-label">转换金额</label>
                        <div class="col-lg-4">
                          <input type="text" id="money" name="num" class="form-control" placeholder="">
                        </div>
                      </div>
                      <div class="line line-dashed line-lg pull-in"></div>
                      <div class="form-group">
                        <label class="col-sm-3 control-label">二级密码</label>
                        <div class="col-lg-4">
                          <input type="password" id="pwd" name="num" class="form-control" placeholder="">
                        </div>
                      </div>
                    </div>
                    <footer class="panel-footer text-right bg-light lter">
                      <button type="button" class="btn btn-success btn-s-xs" onclick="zhuan()" >提 交</button>
                    </footer>
                    <header class="panel-heading">转账记录</header>
		            <div class="table-responsive">
		                <table class="table table-striped b-t b-light text-sm">
		                  <thead>
		                    <tr>
		                      <th>交易记录</th>
		                      <th>金额</th>
		                      <th>时间</th>
		                      <th>收益类型</th>
		                    </tr>
		                  </thead>
		                  <tbody>
		                    <foreach name="finance" item="vf">
		                    <tr>
		                      <td>{$vf.content}</td>
		                      <td>{$vf.money}</td>
		                      <td>{$vf.add_time|date='Y-m-d H:i:s',###}</td>
		                      <td>
		                      	<eq name="vf.money_type" value='1'>收入<else/>支出</eq>
		                      </td>
		                    </tr>
		                    </foreach>
		                  </tbody>
		                </table>
		              </div>
		              <footer class="panel-footer">
		                <div class="row">
		                  <div class="col-sm-4 hidden-xs">
		                  <!--  这里不可以删掉 -->
		                  </div>
		                  <div class="col-sm-4 text-center">  </div>
		                  <div class="col-sm-4 text-right text-center-xs">
		                    <ul class="pagination pagination-sm m-t-none m-b-none">
		                      <li>{$page}</li>
		                    </ul>
		                  </div>
		                </div>
		              </footer>
                  </section>
          </form>
          </section>
        </section>
        <a href="#" class="hide nav-off-screen-block" data-toggle="class:nav-off-screen" data-target="#nav"></a> </section>
      <aside class="bg-light lter b-l aside-md hide" id="notes">
        <div class="wrapper">Notification</div>
      </aside>
    </section>
  </section>
</section>
<script src="__PUBLIC__/home/js/app.v2.js"></script> <!-- Bootstrap --> <!-- App --> <script src="__PUBLIC__/home/js/charts/easypiechart/jquery.easy-pie-chart.js" cache="false"></script> <script src="__PUBLIC__/home/js/charts/sparkline/jquery.sparkline.min.js" cache="false"></script> <script src="__PUBLIC__/home/js/charts/flot/jquery.flot.min.js" cache="false"></script> <script src="__PUBLIC__/home/js/charts/flot/jquery.flot.tooltip.min.js" cache="false"></script> <script src="__PUBLIC__/home/js/charts/flot/jquery.flot.resize.js" cache="false"></script> <script src="js/charts/flot/jquery.flot.grow.js" cache="false"></script> <script src="__PUBLIC__/home/js/charts/flot/demo.js" cache="false"></script> <script src="__PUBLIC__/home/js/calendar/bootstrap_calendar.js" cache="false"></script> <script src="__PUBLIC__/home/js/calendar/demo.js" cache="false"></script> <script src="__PUBLIC__/home/js/sortable/jquery.sortable.js" cache="false"></script>
<script src="__PUBLIC__/js/layer/layer.js" type="text/javascript"></script>
</body>
</html>
<script type="text/javascript">
	/***************************************选择币种  然后资产随着改变************************************/
	$("#type").change(function(){
		var t_name = $('#type option:selected').attr("data-name") ? $('#type option:selected').attr("data-name") : '我的资产';
		var t_jifen = $('#type option:selected').attr("data-jifen");
		$('#ass').html(t_name+': <span class="mandatory">*</span>');
	 	$("[name='assect']").val(t_jifen);
	});
	function zhuan(){
		var type=$('#type option:selected').val();
		//alert(type);

		if(type == ""){
			layer.msg("请选择类型");return;
		}
		var money =$('#money').val();
		if(money == ""){
			layer.msg("请输入转换数量");return;
		}	
		var password=$("#pwd").val();
		if(password == ""){
			layer.msg("请输入交易密码");return;
		}
		var url="{:U('Pay/transformation_ok')}";
		$.post(url,{'type':type,'money':money,'password':password},function(data){
			layer.msg(data.info);
			if(data.status==1){
				setTimeout(function(){  //使用  setTimeout（）方法设定定时2000毫秒
					window.location.reload();//页面刷新
				},2000);
			}
			
		});
	}
</script>